package com.csp.dp.ocp;

/**
 * @author Strive
 * @date 2024/1/30 10:16
 */
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        student.eat();
        student.sleep();
        student.study();

        // 不修改学生类（对修改关闭），增加高中生（对扩展开发）
        HighSchoolStudent highSchoolStudent = new HighSchoolStudent();
        highSchoolStudent.eat();
        highSchoolStudent.sleep();
        highSchoolStudent.study();
        highSchoolStudent.doSomeThing();
    }
}
